package com.saikuo.service.controller;

import com.saikuo.service.api.ApiResultModel;
import com.saikuo.service.service.IAdvertisementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chenzhuo on 16/7/25.
 */
@Api(value = "图片接口", description = "banner广告条，icon药品分类等")
@RestController
@RequestMapping("/ad")
public class AdvertisementController {

    @Autowired
    private IAdvertisementService advertisementService;

    @ApiOperation(value="获取图片地址前缀")
    @RequestMapping(value = "/getPicUrlPre", method = RequestMethod.GET)
    public ApiResultModel getPicUrlPre() {
        return new ApiResultModel(advertisementService.getPicUrlPre());
    }

    @ApiOperation(value="获取轮播广告头")
    @RequestMapping(value = "/get/banner", method = RequestMethod.GET)
    public ApiResultModel getBanner() {
        return new ApiResultModel(advertisementService.getBanner());
    }

    @ApiOperation(value="获取药品类型icon")
    @RequestMapping(value = "/get/category", method = RequestMethod.GET)
    public ApiResultModel getCategory() {
        return new ApiResultModel(advertisementService.getCategory());
    }

    @ApiOperation(value="获取主题特卖icon")
    @RequestMapping(value = "/get/topicSale", method = RequestMethod.GET)
    public ApiResultModel getThemeSale() {
        return new ApiResultModel(advertisementService.getTopicSale());
    }

    @ApiOperation(value="获取免邮资格信息")
    @RequestMapping(value = "/get/postage", method = RequestMethod.GET)
    public ApiResultModel getPostage() {
        return new ApiResultModel(advertisementService.getPostageView());
    }
}
